package com.yanze.mvvmlearndemo;

import android.content.Intent;
import android.databinding.DataBindingUtil;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;

import com.yanze.mvvmlearndemo.databinding.ActivityMainBinding;
import com.yanze.mvvmlearndemo.moudles.BindListViewActivity;
import com.yanze.mvvmlearndemo.moudles.UserEntity;

public class MainActivity extends AppCompatActivity {
    public static final String imgUrl = "http://upload-images.jianshu.io/upload_images/1359048-2e602d235daeda03.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240";
    public static final String imgUrl2 = "http://assets.tianmaying.com/md-image/0f7bfc3b4bb89562737510b0af1f7ad0.png";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        ActivityMainBinding activityMainBinding = DataBindingUtil.setContentView(this, R.layout.activity_main);
        UserEntity user = new UserEntity("彦泽", "白泽丶", 22, imgUrl);
        activityMainBinding.setUser(user);

        com.yanze.mvvmlearndemo.moudles.req.UserEntity user2 = new com.yanze.mvvmlearndemo.moudles.req.UserEntity("彦泽2", "君子彦丶", "男", imgUrl);
        activityMainBinding.setUser2(user2);
    }

    //绑定ListView
    public void jump1(View view) {
        startActivity(new Intent(this, BindListViewActivity.class));
    }
}
